home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol2 / snip_verticalscroller.dba < prev    next >
Encoding:
Text File  |  2000-08-20  |  824 b   |  48 lines

  1. `    ------------------------------------------------------------------------
  2. `    Vertical Scroller                          DarkForge Snippet (19/8/2000)
  3. `    ------------------------------------------------------------------------
  4. `    Full-screen vertical scrolling with image-wraparound
  5. `    Doesn't actually "scroll" anything
  6.  
  7. sync rate 0
  8. sync on
  9. hide mouse
  10.  
  11. load bitmap "anhk_inside.bmp",1
  12. create bitmap 2,640,480
  13.  
  14. set current bitmap 1
  15. for i=1 to 480
  16.     get image i,0,i-1,640,i
  17. next i
  18.  
  19. set text opaque
  20. ink rgb(255,255,255),0
  21.  
  22. dim y(480)
  23. for a=1 to 480
  24.     y(a)=a
  25. next a
  26.  
  27. do
  28.  
  29.     set current bitmap 2
  30.  
  31.     for i=1 to 480
  32.         paste image y(i),0,i
  33.         oldy=y(i)
  34.         inc oldy
  35.         if oldy>480 then oldy=1
  36.         y(i)=oldy
  37.     next i
  38.  
  39.     text 0,0,str$(screen fps())
  40.  
  41.     set current bitmap 0
  42.     copy bitmap 2,0
  43.  
  44.     sync
  45.  
  46. loop
  47.  
  48.